class Feed::MoneyIntroduceToBindFetion < Feed
  
  validates_presence_of :added_money
  validates_presence_of :user_id,
    :money,
    :mobile
    
  def before_create
    self.version = 1
    self.added_money = 500
    self.money = user.money + 500
  end
  
  def after_create
    user.money += added_money
    user.save(false)
  end
  
  # to template
  def to_t
    ":user介绍:introducedor于:created_at_ago_in_words前绑定了飞信, 获得了:added_money麦粒的:bounty_of_introduce_to_bind_fetion"
  end
end